gtk: Just use current time for showing urls
authorMatthias Clasen <mclasen@redhat.com>
Sat, 11 Apr 2020 17:10:20 +0000 (13:10 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 11 Apr 2020 21:29:27 +0000 (17:29 -0400)
We don't really have an event anywhere close in most
cases, and we already pass GDK_CURRENT_TIME in half
the cases anyway.

If we want to be serious about this, we need to pass
the event itself, since future focus-stealing protocols
may not rely on just a timestamp.

gtk/gtkaboutdialog.c
gtk/gtkfilechooserwidget.c
gtk/gtklabel.c

index c3ce0403cbbe1102c4baa0149e7d0b1140d1f017..577eb6e6333faf96e6c7e6ff0c15a0dce930b23c 100644 (file)
@@ -981,7 +981,7 @@ gtk_about_dialog_activate_link (GtkAboutDialog *about,
 {
   GError *error = NULL;
 
-  if (!gtk_show_uri_on_window (GTK_WINDOW (about), uri, gtk_get_current_event_time (), &error))
+  if (!gtk_show_uri_on_window (GTK_WINDOW (about), uri, GDK_CURRENT_TIME, &error))
     {
       GtkWidget *dialog;
 
index f02939df3ea87991e408f42715f8d411f87dcbfd..c7f6b34c319bf36eff768375170923de54d8c1b1 100644 (file)
@@ -1502,7 +1502,7 @@ open_folder_cb (GSimpleAction *action,
       gchar *uri;
 
       uri = g_file_get_uri (file);
-      gtk_show_uri_on_window (GTK_WINDOW (toplevel), uri, gtk_get_current_event_time (), NULL);
+      gtk_show_uri_on_window (GTK_WINDOW (toplevel), uri, GDK_CURRENT_TIME, NULL);
       g_free (uri);
     }
 
index f930b2de73e533bfd12b424cc18a3bb47c6ece28..6f6efaec6440db05901efa6b9ec4a514c14bd8be 100644 (file)
@@ -5816,13 +5816,12 @@ gtk_label_activate_link (GtkLabel    *label,
 {
   GtkWidget *widget = GTK_WIDGET (label);
   GtkWidget *toplevel = GTK_WIDGET (gtk_widget_get_root (widget));
-  guint32 timestamp = gtk_get_current_event_time ();
   GError *error = NULL;
 
   if (!GTK_IS_WINDOW (toplevel))
     return FALSE;
 
-  if (!gtk_show_uri_on_window (GTK_WINDOW (toplevel), uri, timestamp, &error))
+  if (!gtk_show_uri_on_window (GTK_WINDOW (toplevel), uri, GDK_CURRENT_TIME, &error))
     {
       g_warning ("Unable to show '%s': %s", uri, error->message);
       g_error_free (error);